package org.mobicents.servlet.sip.example;

import javax.servlet.sip.URI;

public class CUser {
	private String login;
	private URI locationURI;
	private String ip;
	
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public URI getLocationURI() {
		return locationURI;
	}
	public void setLocationURI(URI locationURI) {
		this.locationURI = locationURI;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String Ip) {
		this.ip = Ip;
	}
	public CUser(String login, URI locationURI) {
		super();
		this.login = login;
		this.locationURI = locationURI;
		String uri = locationURI.toString();
		
		String[] tab = uri.split(":");
		
		uri = tab[1];
		int beginIndex = uri.indexOf('@') + 1;
		
		this.ip = uri.substring(beginIndex, uri.length());
		System.out.println("login " + login + " " + locationURI + " " + ip);
	}	
}
